onmessage = function(e) {
	// 以下内容不会被打印出来
    console.log('Worker: Message received from main script');
	let result = e.data[0] * e.data[1];
    if (isNaN(result)) {
      	postMessage('Please write two numbers');
    } else {
		let workerResult = result;
		postMessage(workerResult);
    }
}

onerror = function (e) {
	console.error(e);
}

onmessageerror = function (e) {
	console.error(e);
}

// 主动关闭
// self.close();